import request, { Method, buyerUrl, expertUrl } from "@/plugins/request.js";
// 查询绑定的咨询人
export function getDoctor(data) {
  return request({
    url: buyerUrl + "/buyer/passport/member/user/findRelationUser",
    method: Method.POST,
    headers: {
      "Content-Type": "application/json",
    },
    needToken: true,
    data,
  });
}
// 绑定咨询人
export function bindDoctor(data) {
  return request({
    url: buyerUrl + "/buyer/passport/member/user/bindRelationUser",
    method: Method.POST,
    headers: {
      "Content-Type": "application/json",
    },
    needToken: true,
    data,
  });
}
// 查询绑定医生坐班时间
export function findDoctor(data) {
  return request({
    url: `${expertUrl}/expert/site/siteRoomTime/expertTimeDetail/${data.expertId}/${data.siteId}/${data.week}`,
    method: Method.GET,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    needToken: true,
    data,
  });
}
// 查询绑定医生一周坐班
export function findWeek(data) {
  return request({
    url: `${expertUrl}/expert/site/siteRoomTime/expertTimeIsSurplus/${data.expertId}/${data.siteId}`,
    method: Method.GET,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    needToken: true,
    data,
  });
}
// 用户新增挂号预约
export function goSave(data) {
  return request({
    url: buyerUrl + "/buyer/user/userRegister/save",
    method: Method.POST,
    headers: {
      "Content-Type": "application/json",
    },
    needToken: true,
    data,
  });
}
// 新增线下预约
export function addPatienti(data) {
  return request({
    url: `${buyerUrl}/buyer/user/userRegister/save`,
    method: Method.POST,
    headers: {
      "Content-Type": "application/json",
    },
    needToken: true,
    data,
  });
}
